public class Hotswap{
    public static void main(String[] args) throws Exception{
        while (true) {
            ClassLoader loader = new HotswapClassLoader();
            Class<?> clazz = loader.loadClass("MonitorImpl");
            Monitor monitor = (Monitor)clazz.getDeclaredConstructor().newInstance();
            monitor.report();
            Thread.currentThread().sleep(2000);
        }
    }
}
